package com.pai4j.common.enums.community;
import com.pai4j.common.constants.MessageConstants;
import lombok.Getter;


/***
 * 对资源的操作行为：点赞、收藏、分享、浏览、打赏
 */
@Getter
public enum ResourceBehaviorTypeEnum {

    LIKE("点赞"), COLLECT("收藏"), SHARE("分享"), STAR("星标"), FOCUS("关注/加入"),

    VIEW("预览/浏览"), CLICK("点击"), REWARD("打赏");

    private String behaviorName;

    ResourceBehaviorTypeEnum(String behaviorName) {
        this.behaviorName = behaviorName;
    }

    public String getBehavior() {
        return this.name();
    }

    public static MessageConstants.TypeEnum getMessageType(String behaviorType) {
        if (LIKE.name().equals(behaviorType)) {
            return MessageConstants.TypeEnum.LIKE;
        }
        if (COLLECT.name().equals(behaviorType)) {
            return MessageConstants.TypeEnum.COLLECT;
        }
        return null;
    }

}
